%lex

%%

\s+ /* skip whitespace */

\"[^\"]*\" return 'STRING'

\d+ return 'NUMBER'

[\w\-+*=<>/]+ return 'SYMBOL'

/lex


%%

Exp
  : Atom
  | List
  ;

Atom
  : NUMBER {  $$ = Number($1) }
  | STRING
  | SYMBOL
  ;


List
  : '(' ListEntries ')' { $$ = $2 }
  ;

ListEntries
  : ListEntries Exp { $1.push($2); $$ = $1 }
  | /* empty */ { $$ = [] }
  ;